<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>一般安全生产法人单位基础信息</title>
    <link rel="stylesheet" type="text/css" href="/css/street/street.css"/>
    <link rel="stylesheet" href="/css/officialDocument/officialDocument.css">
    <link rel="stylesheet" href="/lib/pagination/style/pagination.css">
    <link rel="stylesheet" href="/lib/laydate/need/laydate.css">
    <link rel="stylesheet" href="/css/base.css">
    <script src="/lib/jQuery-File-Upload-master/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.ui.widget.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.iframe-transport.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/jQuery-File-Upload-master/jquery.fileupload.js" type="text/javascript" charset="utf-8"></script>
    <script src="/lib/layer/layer.js?20201106" type="text/javascript" charset="utf-8"></script>
    <script src="/js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="/js/base/tablePage.js"></script>
    <script src="/lib/laydate/laydate.js"></script>
    <script src="/lib/jquery.form.min.js"></script>
    <style>
        .header {
            background-color: #f7f7f7;
        }
        .header {
            height: 45px;
            border-bottom: #999 1px solid;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            padding-left: 20px;
            width: 100%;
            background-color: #fff;
            z-index: 99999;
        }
        .M-box .active, .M-box1 .active, .M-box2 .active, .M-box3 .active {
            background: #2f80d1!important;
            border: 1px solid #2b7fe0!important;
            margin: 0 3px!important;
            width: 29px!important;
            height: 29px!important;
            line-height: 29px!important;
            font-size: 12px!important;
        }
        .jump-ipt {
            margin: 0 3px;
            width: 28px;
            height: 26px;
            line-height: 26px;
            font-size: 12px;
        }
        .M-box a, .M-box1 a, .M-box2 a, .M-box3 a {
            margin: 0 3px!important;
            width: 29px!important;
            height: 29px!important;
            line-height: 29px!important;
            font-size: 12px!important;
        }
        td a:first-child{
            margin-right: 10px;
        }
        body{
            background-color: #f7f7f7;
        }
        .header{
            background-color: #f7f7f7;
        }
        .formHead{
            height: 40px;
        }
        .formHead span{
            line-height:40px;
        }
        .formbox{
            border: 1px solid #dedede;
            width: 900px;
            background-color: #fff;
            margin: 0 auto;
            border-radius: 2px;
            padding: 0 20px;
            padding-bottom: 10px;
        }
        .spans1{
            height: 20px;
            border-left: 7px solid #2b7ee0;
            margin-right: 5px;
            display: inline-block;
            position: absolute;
            top: 11px;
        }
        .span1title{
            height: 40px;
            display: inline-block;
            font-size: 18px;
            margin-left: 15px;
            font-weight: 600;
            color: #151515;
        }
        .secondtitle{
            height: 40px;
            line-height: 40px;
            margin-top: 15px;
            position: relative;
            z-index: 998;
        }
        .secondtitlespan{
            position: absolute;
            z-index: 99999;
            font-size: 16px;
            color: #2b7ee0;
            font-weight: 600;
            background-color: #fff;
        }
        .line{
            width: 100%;
            height: 20px;
            border-bottom: 1px dashed #ccc;
            position: relative;
            z-index: 900;
        }
        .formbox td{
            position: relative;
            height: 40px;
            line-height: 40px;
            font-size: 12px;
            color: #424242;
            font-weight: 600;
            padding: 5px 10px;
            text-align: right;
        }
        .longText{
            width: 100%;
            border: 1px solid #d6d6d6;
            background-color: #f7f7f7;
            -webkit-border-radius: 6px;
            -moz-border-radius:6px;
            border-radius:6px;
            text-indent: 10px;
        }
        .longText1{
            width: 220px;
        }
        .selectbox{
            text-indent: 10px;
            width: 100%;
            border: 1px solid #d6d6d6;
            background-color: #f7f7f7;
            -webkit-border-radius: 6px;
            -moz-border-radius:6px;
            border-radius:6px;
        }
        .dwbtn{
            position: absolute;
            width: 60px;
            height: 30px;
            background-color: #228cdc;
            color: #fff;
            right: -0px;
            border-radius: 3px;
            cursor: pointer;
            top: 11px;
        }
        .lastbtn{
            width: 100px;
            height: 30px;
            background-color: #228cdc;
            color: #fff;
            border-radius: 5px;
            cursor: pointer;
        }
        .img_box{
            font-weight: 500;
        }
        .longspan{
            line-height: 30px;
            display: inline-block;
        }
        .longspan1{
            line-height: 20px;
            display: inline-block;
        }
        .num1,.num2{
            display: none;
        }
        select{
            height: 30px;
        }
        .inputcheck{
            float: left;
            width: 60px;
            height: 30px;
            line-height:30px;
        }
        .inputcheck input{
            height: 30px;
        }
        .inputcheck span{
            margin-right: 10px;
        }

    </style>
</head>
<body>
    <div class="header">
        <img src="/img/icon_unitManagement.png" class="fl" style="margin-top: 7px;">
        <div class="headertitle"> 企业信息</div>
    </div>
    <div class="mainDatas" style="margin-top: 65px;margin-bottom: 45px;" data-id="0">
        <form action="/sv1/generalsafetyunit/insertSelective" class="formbox" method="post">
            <div class="formHead" style="border-bottom: 1px solid #d6d6d6;position:relative;">
                <span class="spans1"></span>
                <span class="span1title">一般安全生产法人单位基础信息</span>
                <span class="tbsj" style="float:right;margin-left: 10px;margin-right: 20px;"></span>
                <input type="hidden" name="tbsj">
                <span class="lxdh" style="float:right;margin-left: 10px;"></span>
                <input type="hidden" name="lxdh">
                <span class="tbr" style="float:right;"></span>
                <input type="hidden" name="tbr">
            </div>

            <div class="firstbox">
                <div class="secondtitle">
                    <span class="secondtitlespan">&nbsp;&nbsp;&nbsp;&nbsp;详细信息&nbsp;&nbsp;</span>
                    <div class="line"></div>
                </div>
                <table style="border-collapse: initial;padding: 0 40px;">
                    <tbody>
                        <tr>
                            <td style="width: 150px;">
                                <span>组织机构代码：</span>
                            </td>
                            <td style="width: 220px;">
                                <input type="text" class="longText" name="organizationCode">
                            </td>
                            <td style="width: 150px;">
                                <img src="../img/mg2.png" alt="" style="position: absolute;top: 20px;left: 60px;">
                                <span>单位详细名称：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="unitName">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <img src="../img/mg2.png" alt="" style="position: absolute;top: 20px;left: 85px;">
                                <span>企业坐标：</span>
                            </td>
                            <td style="width: 220px;">
                                <input type="text" class="longText" readonly="readonly" name="enterpriseCoordinate">
                                <button class="dwbtn" type="button">点击定位</button>
                            </td>
                            <td style="width: 150px;">
                                <img src="../img/mg2.png" alt="" style="position: absolute;top: 20px;left: 85px;">
                                <span>企业状态：</span>
                            </td>
                            <td>
                                <select name="enterpriseState" class="selectbox"><option value="0">请选择</option><option value="01">合格达标</option><option value="02">一般隐患</option><option value="03">突出隐患</option><option value="04">重大隐患</option></select>
                            </td>
                        </tr>
                    <tr>
                        <td>
                            <img src="../img/mg2.png" alt="" style="position: absolute;top: 20px;left: 85px;">
                            <span>所属社区：</span>
                        </td>
                        <td>
                            <select name="gridCode" id="grid" class="selectbox"></select>
                        </td>
                        <td colspan="2">

                        </td>
                    </tr>

                    </tbody>
                </table>
                <table class="impbox" style="padding: 0 40px;border-collapse: initial;">
                    <tbody>
                        <tr>
                            <td colspan="2" style="text-align: left;padding-left: 5px;font-size: 15px;color: #2b7ee0;">行业类别：</td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">主要业务活动(或主要产品)：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="mainBusinessOrProduct" class="selectbox" style="width: 226px;"><option value="0">请选择</option><option value="01">易燃易爆物品生产经营</option><option value="02">危险化学品或易制毒化学品生产经营、运输、储存企业</option><option value="03">食品饮料生产经营</option><option value="04">乳制品生产经营</option><option value="05">屠宰、肉类加工</option><option value="06">非煤矿山开采</option><option value="07">互联网上网服务场所、营业性网站、声讯服务业</option><option value="08">公共聚集场所经营（餐馆、酒店、宾馆/旅店/足浴、洗浴、按摩场所/美容、理发）</option><option value="09">娱乐服务（歌舞厅、演艺厅、影视厅、电子游戏、棋牌）</option><option value="10">营利性医疗机构/药品、医疗器械生产经营</option><option value="11">种子、农药、化肥生产经营</option><option value="12">卫星地面接收设施生产、安装</option><option value="13">印刷与复印</option><option value="14">图书报刊及音像制品经营</option><option value="15">房地产/房地产经纪/建筑施工/室内装饰装修</option><option value="16">公共交通、运输服务业</option><option value="17">机动车改装、维修及零配件生产</option><option value="18">金融、证券及保险</option><option value="19">其他</option></select>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">行业类别代码(GB/T 4754-2011)：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="industryCategoryCode">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">单位组织结构情况：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="unitOrganizationalStructure" class="selectbox selectbox1" style="width: 226px;"><option value="0">请选择</option><option value="1">独立企业</option><option value="2">集团公司母公司或成员企业</option><option value="3">分支机构</option></select>
                            </td>
                        </tr>
                        <tr class="num1">
                            <td style="width: 150px;">
                                <span class="longspan">集团公司母公司或成员企业：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="unitLocationTown" class="selectbox" style="width: 226px;"><option value="0">请选择</option><option value="2-1">集团公司母公司</option><option value="2-2">成员企业</option></select>
                            </td>
                        </tr>
                        <tr  class="num2">
                            <td style="width: 150px;">
                                <span class="longspan">填写上级法人组织机构代码：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="superiorUnitOrganizationCode">
                            </td>
                        </tr>
                        <tr class="num2">
                            <td style="width: 150px;">
                                <span class="longspan">上级法人单位详细名称：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="superiorUnitName">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: left;padding-left: 5px;font-size: 15px;color: #2b7ee0;">单位所在地及区划：</td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">区(县)乡(镇)街(村)门牌号：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="unitLocationArea">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">单位位于(街道办事处社区或居委会)：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="subdistrictOffice">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="text-align: left;padding-left: 5px;font-size: 15px;color: #2b7ee0;">单位注册地及区划：</td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan1">省(自治区、直辖市)地(区、市、州、盟)县(区、市、旗)：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="unitRegistrationPlaceProvince">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span>乡(镇)街(村)门牌号：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="unitRegistrationPlaceHouseNo">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">注册地位于(街道办事处社区或居委会)：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="registrationSubdistrictOffice">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">从业人员期末人数：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="Number2011">
                            </td>
                        </tr>
                    </tbody>
                </table>

                <table style="border-collapse: initial;padding: 0 40px;">
                    <tbody>
                        <tr>
                            <td style="width: 150px;">
                                <img src="../img/mg2.png" alt="" style="position: absolute;top: 20px;left: 5px;">
                                <span  class="longspan">法定代表人(单位负责人)：</span>
                            </td>
                            <td style="width: 220px;">
                                <input type="text" class="longText" name="legalRepresentative">
                            </td>
                            <td style="width: 150px;">
                                <span>开业(成立)时间：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="establishmentTime" readonly="readonly"  onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span>固定电话：</span>
                            </td>
                            <td style="width: 220px;">
                                <input type="text" class="longText" name="fixedTelephone">
                            </td>
                            <td style="width: 150px;">
                                <img src="../img/mg2.png" alt="" style="position: absolute;top: 20px;left: 85px;">
                                <span>移动电话：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="mobilePhone">                            </td>
                        </tr>
                    </tbody>
                </table>

                <table class="impbox" style="padding: 0 40px;border-collapse: initial;">
                    <tbody>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">工商登记注册号：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="businessRegistrationNo">
                            </td>
                        </tr>
                    </tbody>
                </table>

                <table class="impbox" style="padding: 0 40px;border-collapse: initial;">
                    <tbody>
                        <tr>
                            <td style="width: 166px;">
                                <img src="../img/mg2.png" alt="" style="position: absolute;top: 20px;left: 60px;">
                                <span class="longspan">登记注册类型：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="typesOfRegistration" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="110">国有</option>
                                    <option value="120">集体</option>
                                    <option value="130">股份合作</option>
                                    <option value="141">国有联营</option>
                                    <option value="142">集体联营</option>
                                    <option value="143">国有与集体联营</option>
                                    <option value="149">其他联营</option>
                                    <option value="151">国有独资公司</option>
                                    <option value="159">其他有限责任公司</option>
                                    <option value="160">股份有限公司</option>
                                    <option value="171">私营独资</option>
                                    <option value="172">私营合伙</option>
                                    <option value="173">私营有限责任公司</option>
                                    <option value="174">私营股份有限公司</option>
                                    <option value="190">其他</option>
                                    <option value="210">与港澳台商合资经营</option>
                                    <option value="220">与港澳台商合作经营</option>
                                    <option value="230">港澳台商独资</option>
                                    <option value="240">港澳台商投资股份有限公司</option>
                                    <option value="290">其他港澳台投资</option>
                                    <option value="310">中外合资经营</option>
                                    <option value="320">中外合作经营</option>
                                    <option value="330">外资企业</option>
                                    <option value="340">外商投资股份有限公司</option>
                                    <option value="390">其他外商投资</option>
                                </select>
                            </td>
                            <td style="width: 150px;">
                                <span class="longspan">登记注册现状：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="typesOfRegistrationState" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">营业</option>
                                    <option value="2">停业(歇业)</option>
                                    <option value="3">关闭</option>
                                </select>
                            </td>
                        </tr>

                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">地上建构筑物面积：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="aboveGroundArea">
                            </td>
                            <td style="width: 150px;">
                                <span class="longspan">地下建构筑物面积：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="undergroundArea">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">地下面积用途：</span>
                            </td>
                            <td>
                                <input type="text" class="longText" name="undergroundAreaUse">
                            </td>

                        </tr>
                    </tbody>
                </table>
                <table class="impbox" style="padding: 0 40px;border-collapse: initial;">
                    <tbody>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">专业检测：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="professionalTesting" class="selectbox selectbox2" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">建筑消防设施检测最近一次检测时间</option>
                                    <option value="2">电气防火技术检测最近一次检测时间</option>
                                    <option value="3">防雷装置检测最近一次检测时间</option>
                                    <option value="4">其他最近一次检测时间</option>
                                </select>
                            </td>
                        </tr>
                        <tr class="jcsj" style="display: none;">
                            <td style="width: 150px;">
                                <span class="longspan">最近一次检测时间：</span>
                            </td>
                            <td>
                                <input type="text" class="longText longText1" name="lastInspectionTime" readonly="readonly" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">是否涉及危险化学品：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="hazardousChemicalsInvolved" class="selectbox selectbox3" style="width: 226px;"><option value="0">请选择</option><option value="1">是</option><option value="2">否</option></select>
                            </td>
                        </tr>
                        <tr class="sjwx" style="display: none;">
                            <td style="width: 150px;">
                                <span class="longspan">涉危企业类型（可多选）：</span>
                            </td>
                            <td>
                                <div class="inputcheck"><input type="checkbox" value="0"><span>生产</span></div>
                                <div class="inputcheck"><input type="checkbox" value="1"><span>经营</span></div>
                                <div class="inputcheck"><input type="checkbox" value="2"><span>储存</span></div>
                                <div class="inputcheck"><input type="checkbox" value="3"><span>运输</span></div>
                                <div class="inputcheck"><input type="checkbox" value="4"><span>使用</span></div>
                                <input type="hidden" name="typesOfDanger" class="sjwxlx">
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">是否涉及有限空间作业：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="operationsInvolvingFiniteSpaces" class="selectbox selectbox4" style="width: 226px;"><option value="0">请选择</option><option value="1">是</option><option value="2">否</option></select>
                            </td>
                        </tr>
                        <tr class="yxkj" style="display: none;">
                            <td style="width: 150px;">
                                <span class="longspan">有限空间类型（可多选）：</span>
                            </td>
                            <td>
                                <div class="inputcheck" style="width: 85px"><input type="checkbox" value="0"><span>密闭设备</span></div>
                                <div class="inputcheck" style="width: 115px"><input type="checkbox" value="1"><span>地下有限空间</span></div>
                                <div class="inputcheck" style="width: 115px"><input type="checkbox" value="2"><span>地上有限空间</span></div>
                                <input type="hidden" name="finiteSpaceType" class="yxkjlx">
                            </td>
                        </tr>
                    </tbody>
                </table>
                <table class="impbox" style="padding: 0 40px;border-collapse: initial;">
                    <tbody>
                        <tr>
                            <td style="width: 166px;">
                                <span class="longspan">是否涉及职业危害：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="occupationalHazards" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">是</option>
                                    <option value="2">否</option>
                                </select>
                            </td>
                            <td style="width: 150px;">
                                <span class="longspan">有无消防中控室：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="centralControlRoom" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">有</option>
                                    <option value="2">无</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 166px;">
                                <span class="longspan">有无配电室：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="electricityDistributionRoom" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">有</option>
                                    <option value="2">无</option>
                                </select>
                            </td>
                            <td style="width: 150px;">
                                <span class="longspan">有无燃气或液化石油气场所：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="gasOrLiquefiedPetroleumGasField" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">有</option>
                                    <option value="2">无</option>
                                </select>
                            </td>
                        </tr>

                        <tr>
                            <td style="width: 166px;">
                                <span class="longspan">有无特种设备：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="specialEquipment" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">有</option>
                                    <option value="2">无</option>
                                </select>
                            </td>
                            <td style="width: 150px;">
                                <span class="longspan">有无特种作业人员：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="specialOperationPersonnel" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">有</option>
                                    <option value="2">无</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 166px;">
                                <span class="longspan">有无重大危险源：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="majorHazardInstallations" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">有</option>
                                    <option value="2">无</option>
                                </select>
                            </td>
                            <td style="width: 150px;">
                                <span class="longspan">有无安全生产许可：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="safeProductionLicense" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">有</option>
                                    <option value="2">无</option>
                                </select>
                            </td>
                        </tr>

                        <tr>
                            <td style="width: 166px;">
                                <span class="longspan">有无行业资质：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="industryQualification" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">有</option>
                                    <option value="2">无</option>
                                </select>
                            </td>
                            <td style="width: 150px;">
                                <span class="longspan">安全生产标准化评审等级：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="safetyProductionLevel" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">一级</option>
                                    <option value="2">二级</option>
                                    <option value="3">三级</option>
                                    <option value="4">无</option>
                                </select>
                            </td>
                        </tr>
                    </tbody>
                </table>

                <table  class="impbox" style="padding: 0 40px;border-collapse: initial;">
                    <tbody>
                        <tr>
                            <td style="width: 150px;">
                                <span class="longspan">安全文化建设示范企业命名等级：</span>
                            </td>
                            <td style="text-align: left;">
                                <select name="safetyDemonstrationLevel" class="selectbox" style="width: 226px;">
                                    <option value="0">请选择</option>
                                    <option value="1">国家级</option>
                                    <option value="2">市级</option>
                                    <option value="3">无</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 150px;">
                                <span>备注：</span>
                            </td>
                            <td style="padding-top: 12px;">
                                <textarea name="remarks" class="longText" style="padding-top: 5px;height: 60px;"></textarea>
                            </td>
                        </tr>
                        <tr style="border: none;">
                            <td style="width: 150px;">
                                <span style="line-height: 30px;display: inline-block;">营业执照附件：</span>
                            </td>
                            <td style="text-align: left;" colspan="3">
                                <input data-url="/upload?module=grid" type="file" multiple="multiple" name="file" id="uploadinputimgs" class="w-icon5" style="position: absolute;opacity: 0;width: 70px;filter: progid:DXImageTransform.Microsoft.Alpha(opacity=0)">
                                <a href="#" id="uploadimgs"><img style="margin-right:5px;" src="../img/icon_uplod.png">添加附件</a>
                                <div class="img_box"></div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
            <div style="width: 100%;height: 50px;">
                <div style="width: 235px;margin: 0 auto;">
                    <button class="lastbtn" id="savebtn" type="button" onclick="formsubmit($(this))">保存</button>
                    <button class="lastbtn" style="margin-left: 30px;background-color: #95aabe" id="closebtn" type="button" onclick="closebtns($(this))">返回</button>
                </div>
            </div>
        </form>
    </div>

    <script>
        var objtwo=$.GetRequest();
//        var tbr = decodeURI(objtwo.tbr);
//        var tbsj = decodeURI(objtwo.tbsj);
//        var lxdh = decodeURI(objtwo.lxdh);
        var types = decodeURI(objtwo.types);
        var fixFromId = decodeURI(objtwo.fixFromId);

        function getGrid(){
            $.get('/code/getCode?parentNo=TYPE_OF_ACCOUNT',function(res){
                var str ='<option value="">请选择</option>'
                var data = res.obj;
                for(var i=0;i<data.length;i++){
                    str += '<option value="'+data[i].codeNo+'">'+data[i].codeName+'</option>'
                }
                $('#grid').html(str)

            })
        }

        $(function(){
            getGrid();
            $.get('/fixForm/getUserInfo',function(res){
                var tbr=res.data.userName;
                var tbsj=new Date().Format('yyyy-MM-dd hh:mm:ss');
                var lxdh=res.data.mobilNo

                if(types == 'undefined'){
                    $('.tbr').html('填表人：'+tbr);
                    $('.tbsj').html('填表时间：'+tbsj);
                    $('.lxdh').html('联系电话：'+lxdh);
                    $('.formHead input[name=tbr]').val(tbr);
                    $('.formHead input[name=tbsj]').val(tbsj);
                    $('.formHead input[name=lxdh]').val(lxdh);
                }else{
                    $('.formbox').attr('action','/sv1/generalsafetyunit/updataByPrimaryKeySelective?generalSafetyUnitId='+fixFromId);
                    $.ajax({
                        url:'/fixForm/selectByListFixFromId?type=1&fixFromId='+fixFromId,
                        typeOf:'json',
                        data:{},
                        type:'get',
                        success:function(obj){
                            var data = obj.data;
                            $('.tbr').html('填表人：'+data.formHolder);
                            $('.tbsj').html('填表时间：'+data.dateOfPublication);
                            $('.lxdh').html('联系电话：'+data.contactNumber);
                            $('.formHead input[name=tbr]').val(data.formHolder);
                            $('.formHead input[name=tbsj]').val(data.dateOfPublication);
                            $('.formHead input[name=lxdh]').val(data.contactNumber);
                            $('input[name=organizationCode]').val(data.organizationCode);
                            $('input[name=unitName]').val(data.unitName);
                            $('input[name=enterpriseCoordinate]').val(data.enterpriseCoordinate);
                            $('select[name=enterpriseState]').val(data.enterpriseState);
                            $('select[name=mainBusinessOrProduct]').val(data.mainBusinessOrProduct);
                            $('input[name=industryCategoryCode]').val(data.industryCategoryCode);
                            $('select[name=unitOrganizationalStructure]').val(data.unitOrganizationalStructure);
                            if(data.unitOrganizationalStructure == 2){
                                $('.num1').show();$('.num2').show();
                            }else if(data.unitOrganizationalStructure == 3){
                                $('.num2').show();
                            }
                            $('#grid').val(data.gridCode)
                            $('input[name=unitLocationArea]').val(data.unitLocationArea);
                            $('input[name=subdistrictOffice]').val(data.subdistrictOffice);
                            $('input[name=unitRegistrationPlaceProvince]').val(data.unitRegistrationPlaceProvince);
                            $('input[name=unitRegistrationPlaceHouseNo]').val(data.unitRegistrationPlaceHouseNo);
                            $('input[name=registrationSubdistrictOffice]').val(data.registrationSubdistrictOffice);
                            $('input[name=Number2011]').val(data.number2011);
                            $('input[name=legalRepresentative]').val(data.legalRepresentative);
                            $('input[name=establishmentTime]').val(data.establishmentTime);
                            $('input[name=fixedTelephone]').val(data.fixedTelephone);
                            $('input[name=mobilePhone]').val(data.mobilePhone);
                            $('input[name=businessRegistrationNo]').val(data.businessRegistrationNo);
                            $('select[name=typesOfRegistration]').val(data.typesOfRegistration);
                            $('select[name=typesOfRegistrationState]').val(data.typesOfRegistrationState);
                            $('input[name=aboveGroundArea]').val(data.aboveGroundArea);
                            $('input[name=undergroundArea]').val(data.undergroundArea);
                            $('input[name=undergroundAreaUse]').val(data.undergroundAreaUse);
                            $('select[name=professionalTesting]').val(data.professionalTesting);
                            if(data.unitOrganizationalStructure == 1||data.unitOrganizationalStructure == 2||data.unitOrganizationalStructure == 3||data.unitOrganizationalStructure == 4){
                                $('.jcsj').show();
                            }
                            $('input[name=lastInspectionTime]').val(data.lastInspectionTime);
                            $('select[name=unitLocationTown]').val(data.unitLocationTown);
                            $('input[name=superiorUnitOrganizationCode]').val(data.superiorUnitOrganizationCode);
                            $('input[name=superiorUnitName]').val(data.superiorUnitName);
                            $('input[name=typesOfDanger]').val(data.typesOfDanger);
                            $('select[name=hazardousChemicalsInvolved]').val(data.hazardousChemicalsInvolved);
                            if(data.hazardousChemicalsInvolved == 1){
                                $('.sjwx').show();
                                var typesOfDanger = data.typesOfDanger.split(',');
                                var length = typesOfDanger.length;
                                for(var i=0;i<length;i++){
                                    if(typesOfDanger[i] != ''){
                                        console.log(i);
                                        $('.sjwx .inputcheck').eq(i).find('input').attr('checked',true);
                                    }
                                }
                            }
                            $('select[name=operationsInvolvingFiniteSpaces]').val(data.operationsInvolvingFiniteSpaces);
                            $('input[name=finiteSpaceType]').val(data.finiteSpaceType);
                            if(data.operationsInvolvingFiniteSpaces == 1){
                                $('.yxkj').show();
                                var finiteSpaceType = data.finiteSpaceType.split(',');
                                var length = finiteSpaceType.length;
                                for(var i=0;i<length;i++){
                                    if(finiteSpaceType[i] != ''){
                                        $('.yxkj .inputcheck').eq(i).find('input').attr('checked',true);
                                    }
                                }
                            }
                            $('select[name=occupationalHazards]').val(data.occupationalHazards);
                            $('select[name=centralControlRoom]').val(data.centralControlRoom);
                            $('select[name=electricityDistributionRoom]').val(data.electricityDistributionRoom);
                            $('select[name=gasOrLiquefiedPetroleumGasField]').val(data.gasOrLiquefiedPetroleumGasField);
                            $('select[name=specialEquipment]').val(data.specialEquipment);
                            $('select[name=specialOperationPersonnel]').val(data.specialOperationPersonnel);
                            $('select[name=majorHazardInstallations]').val(data.majorHazardInstallations);
                            $('select[name=safeProductionLicense]').val(data.safeProductionLicense);
                            $('select[name=industryQualification]').val(data.industryQualification);
                            $('select[name=safetyProductionLevel]').val(data.safetyProductionLevel);
                            $('select[name=safetyDemonstrationLevel]').val(data.safetyDemonstrationLevel);
                            $('textarea[name=remarks]').val(data.remarks);
                            var data = data.attachment;
                            var str = '';
                            for (var i = 0; i < data.length; i++) {
                                str += '<div class="dech" deUrl="' + encodeURI(data[i].attUrl)+ '"><input type="hidden" name="attachmentName" value="' + data[i].attachName + '*"><a href="<%=basePath %>download?'+encodeURI(data[i].attUrl)+'" NAME="' + data[i].attachName + '*"><img style="margin-right:10px;" src="../img/attachment_icon.png"/>' + data[i].attachName + '</a><img class="deImgs" style="margin-left:5px;cursor: pointer;" src="../img/file/icon_deletecha_03.png"/><input type="hidden" name="attachmentId" class="inHidden" value="' + data[i].aid + '@' + data[i].ym + '_' + data[i].attachId + ',"></div>';
                            }
                            $('.img_box').append(str);
                            if(types == 2){
                                $('input').attr('disabled','disabled');
                                $('select').attr('disabled','disabled');
                                $('textarea').attr('disabled','disabled');
                                $('#savebtn').remove();
                            }
                        }
                    })
                }

            })



            $('.selectbox1').change(function(){
                var num = $('.selectbox1').val();
                if(num == 1){
                    $('.num1').hide();
                    $('.num2').hide();
                }else if(num == 2){
                    $('.num2 input').val('');
                    $('.num1').show();
                    $('.num2').show();
                }else if(num == 3){
                    $('.num2 input').val('');
                    $('.num1').hide();
                    $('.num2').show();
                }
            })
            $('.selectbox2').change(function(){
                var num = $('.selectbox2').val();
                if(num != ''){
                    $('.jcsj input').val('');
                    $('.jcsj').show();
                }else{
                    $('.jcsj input').val('');
                    $('.jcsj').hide();
                }
            })
            $('.selectbox3').change(function(){
                var num = $('.selectbox3').val();
                if(num == 1){
                    $('.sjwx input').attr('checked',false);
                    $('.sjwx').show();
                }else{
                    $('.sjwx input').attr('checked',false);
                    $('.sjwx').hide();
                }
            })
            $('.selectbox4').change(function(){
                var num = $('.selectbox4').val();
                if(num == 1){
                    $('.yxkj input').attr('checked',false);
                    $('.yxkj').show();
                }else{
                    $('.yxkj input').attr('checked',false);
                    $('.yxkj').hide();
                }
            })

            $('#uploadinputimgs').fileupload({
                dataType:'json',
                done: function (e, data) {
                    if(data.result.obj != ''){
                        var data = data.result.obj;
                        var str = '';
                        for (var i = 0; i < data.length; i++) {
                            str += '<div class="dech" deUrl="' + encodeURI(data[i].attUrl)+ '"><input type="hidden" name="attachmentName" value="' + data[i].attachName + '*"><a href="<%=basePath %>download?'+encodeURI(data[i].attUrl)+'" NAME="' + data[i].attachName + '*"><img style="margin-right:10px;" src="../img/attachment_icon.png"/>' + data[i].attachName + '</a><img class="deImgs" style="margin-left:5px;cursor: pointer;" src="../img/file/icon_deletecha_03.png"/><input type="hidden" name="attachmentId" class="inHidden" value="' + data[i].aid + '@' + data[i].ym + '_' + data[i].attachId + ',"></div>';
                        }
                        $('.img_box').html(str);
                    }else{
                        layer.alert('添加附件大小不能为空!',{},function(){
                            layer.closeAll();
                        });
                    }
                }
            });
            //附件删除
            $('.img_box').on('click','.deImgs',function(){
                var data=$(this).parents('.dech').attr('deUrl');
                var dome=$(this).parents('.dech');
                deleteChatment(data,dome);
            })
            $('.dwbtn').click(function () {
//               window.open('/street/chooseMap')
                window.open('/street/mapCoordinates?type=4')
            })


        })
        //删除附件
        function deleteChatment(data,element){
            layer.confirm('<fmt:message code="workflow.th.que" />？', {
                btn: ['<fmt:message code="global.lang.ok" />','<fmt:message code="depatement.th.quxiao" />'], //按钮
                title:"<fmt:message code="notice.th.DeleteAttachment" />"
            }, function(){
                //确定删除，调接口
                $.ajax({
                    type:'get',
                    url:'../delete',
                    dataType:'json',
                    data:data,
                    success:function(res){
                        if(res.flag == true){
                            layer.msg('<fmt:message code="workflow.th.delsucess" />', { icon:6});
                            element.remove();
                        }else{
                            layer.msg('<fmt:message code="lang.th.deleSucess" />', { icon:6});
                        }
                    }
                });
            }, function(){
                layer.closeAll();
            });
        }
        function setZuobiao(str) {
            $('.mainDatas [name="enterpriseCoordinate"]').val(str)
        }
        function theEchozuobiaos(str) {
            $('.mainDatas1 [name="enterpriseCoordinate"]').val(str)
        }

        function formsubmit(e){
            var einfoName = $('input[name=unitName]').val();
            var einfoFix = $('select[name=enterpriseState] option:selected').val();
            var einfoDigest = $('input[name=legalRepresentative]').val();
            var einfoStuts = $('input[name=mobilePhone]').val();
            var einfoDelegatename = $('select[name=typesOfRegistration] option:selected').val();
            var einfoMark = $('input[name=enterpriseCoordinate]').val();
            var grid = $('#grid').val();
            var str = '';
            for(var i=0;i<$('.sjwx .inputcheck').length;i++){
                if($('.sjwx .inputcheck').eq(i).find('input').attr('checked')){
                    str += $('.sjwx .inputcheck').eq(i).find('input').val()+',';
                }
            }
            $('.sjwxlx').val(str);
            var str1= '';
            for(var i=0;i<$('.yxkj .inputcheck').length;i++){
                if($('.yxkj .inputcheck').eq(i).find('input').attr('checked')){
                    str1+= $('.yxkj .inputcheck').eq(i).find('input').val()+',';
                }
            }
            $('.yxkjlx').val(str1);
            if(einfoName!=''&&einfoFix!=''&&einfoDigest!=''&&einfoStuts!=''&&einfoDelegatename!=''&&einfoMark!=''&&grid!=""){
                $('.mainDatas .formbox').ajaxSubmit({
                    dataType:'json',
                    success:function(data){
                        window.history.back(-1);
                    }
                })
            }else{
                layer.msg("必填条件必须填写!",{icon:6});
            }
        }
        function closebtns(e){
            window.history.back(-1);
        }
    </script>
</body>
</html>